package com.ids.service;
 import java.sql.SQLException;
import com.ids.bean.ForgotPassword;
import com.ids.bean.UserInfo;
import com.ids.daoManager.LoginDaoManager;

public class LoginService {
	private static LoginService instance = new LoginService();

	public static LoginService getInstance() {
		return instance;
	}

	public UserInfo getUserInfo(String empCode, String password) {
		return getUserInfo(empCode, password, false);
	}
	public  UserInfo getUserInfo(String empCode, String password,boolean isEncrypted) {
		UserInfo userInfo = LoginDaoManager.getInstance().getUserInfo(empCode, password,isEncrypted );
		return userInfo;
	}

	public boolean changePassword(String empCode, String password,
			String newPassword) {
		return LoginDaoManager.getInstance().changePassword(empCode, password, newPassword);
	}
	public ForgotPassword forgotPassword(String empid) throws SQLException {
		return  LoginDaoManager.getInstance().forgotPassword(empid);
		
	}
	
	public String updateExpired1(String empCode) throws Exception {
		return  LoginDaoManager.getInstance().updateExpired1(empCode);
	}

	public String recoverPassword(String newPassword, String confirmPassword,
			String empCode, String key) throws Exception {
		return  LoginDaoManager.getInstance().recoverPassword( newPassword, confirmPassword, empCode,  key);
	}
	
}
